package com.service.impl;

import java.util.List;

import com.domain.ProductCategory;
import com.pos43.business.dao.IProductTypeDao;
import com.pos43.business.dao.impl.ProductTypeDao;
import com.pos43.business.service.IProductTypeService;
import com.pos43.domain.ProductType;
import com.service.IProductCategoryService;

public class ProductCategoryService implements IProductCategoryService{
	
	IProductCategoryDao productCategoryDao = new ProductCategoryDao();
	
	public Integer addProductCategory(String ptname){
		ProductCategory productCategorynstance = new ProductCategory();
		productCategoryInstance.setPtname(ptname);
		return productCategoryDao.save(productCategoryInstance);
	}
	
	 public void delProductCategory(Integer ptid){
		 productCategoryDao.delete(ptid);
	 }
	 
	 public void updateProductCategory(ProductCategory productCategory){
		 productCategoryDao.update(productCategory);
	 }
	 
	 public List<ProductCategory> listProductCategory(){
		 return productCategoryDao.findAll();
	 }
	 
	 public ProductCategory getProductCategory(Integer ptid){
		 return productCategoryDao.get(ptid);
	 }

	public IProductCategoryDao getProductCategoryDao() {
		return productCategoryDao;
	}

	public void setProductCategoryDao(IProductCategoryDao productCategoryDao) {
		this.productCategoryDao = productCategoryDao;
	}

	

}
